{% extends 'xadmin/includes/sitemenu_default.html' %}
{% load i18n xadmin_tags %}


{% block navbar_md %}
<div class="panel-group hide-sm nav-sitemenu col-md-2" id="nav-accordion" style="overflow-y:auto;height:90%">
  {% for item in nav_menu %}
  <div class="panel panel-default">
    <div class="panel-heading" data-toggle="collapse" href="#nav-panel-{{forloop.counter}}">
      <h6 class="panel-title">
        <span class="badge badge-info">{{ item.menus|length }}</span>
        <a class="accordion-toggle" >
          {% if item.url %}<a href="{{ item.url }}" class="section">{% endif %}
          {% if item.icon %}<i class="fa fa-fw {{item.icon}}"></i>
          {% elif item.first_icon %}<i class="fa fa-fw {{item.first_icon}}"></i>
          {%else%}<i class="fa-fw fa fa-circle-o"></i>{% endif %}
          <strong>{% trans item.title %}</strong>
          {% if item.url %}</a>{% endif %}
        </a>
      </h6>
    </div>
    <div id="nav-panel-{{forloop.counter}}" class="list-group panel-collapse collapse in">
      {% for sitem in item.menus %}
      <a href="{{ sitem.url|default_if_none:'#' }}" class="list-group-item{% if sitem.selected %} active{% endif %}">
        <i class="fa-fw {{sitem.icon}}"></i>
        {{ sitem.title }}
      </a>
      {% endfor %}
    </div>
  </div>
  {% endfor %}
</div>
{% endblock navbar_md %}
